package dao.room;

import domain.Page;
import domain.Room;

import java.util.ArrayList;

public interface RoomDao {
    /**
     * 验证username是否重复
     * @param username
     * @return boolean
     * @author 夏添
     * @date 2020/7/15 21:33
     */
    public boolean ValidateName(String username) throws Exception;

    /**
     * room信息注册
     * @param username,password,phone,community_id,housernum,ownername,housecard_img
     * @return int
     * @author 夏添
     * @date 2020/7/15 21:33
     */
    public int RegisteredRoom(String username,String password,int community_id,String housernum,String ownername,String phone,String housecard_img) throws Exception;

    /**
     * 前台登录验证
     * @param username,password
     * @return room
     * @author 夏添
     * @date 2020/7/18 21:33
     */
    public Room verify(String username , String password) throws Exception;

    /**
     * 住房信息检索
     * @param page,viewpower
     * @return ArrayList
     * @author 夏添
     * @date 2020/7/20 20:16
     */
    public ArrayList<Room> findByPage(Page page,String view_power) throws Exception;

    /**
     * 住房信息搜索
     * @param page,community_id,query
     * @return ArrayList
     * @author 夏添
     * @date 2020/7/20 20:32
     */
    public ArrayList<Room> QueryRoom(Page page,int community_id,String query,String view_power) throws  Exception;

    /**
     * 更新住房信息
     * @param room_id,phone,community_id,housernum,ownername,housecard_img
     * @return int
     * @author 夏添
     * @date 2020/7/20 21:19
     */
    public  int UpdateInfo(int room_id,String phone,String ownername,String hosecard_img) throws Exception;

    /**
     * 审核住房信息
     * @param room_id
     * @return int
     * @author 夏添
     * @date 2020/7/20 21:24
     */
    public int StateYes(int room_id) throws  Exception;

    /**
     * 拒绝住房信息
     * @param room_id
     * @return int
     * @author 夏添
     * @date 2020/7/20 21:26
     */
    public int StateNo(int room_id) throws  Exception;

    /**
     * 获取所有允许查看的住房数据总数
     * @param view_power
     * @return int
     * @author 夏天
     * @date 2020/7/21 15:41
     */
    public int getCount(String view_power) throws Exception;

    /**
     * 获取条件查询的住房数据总数
     * @param community_id,query,view_power
     * @return int
     * @author 夏天
     * @date 2020/7/21 15:41
     */
    public int getCount(int community_id,String query,String view_power) throws  Exception;
}
